﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RFIDStockManagement.IDAL;
using RFIDStockManagement.DAL;
namespace RFIDStockManagement.BLL
{
    public class OutStockCheckManger
    {
        IOutStockCheck checker;
        List<string> rfids;

        /// <summary>
        /// 当前操作的RFID列表
        /// </summary>
        public List<string> RFIDs
        {
            get { return rfids; }
            set { rfids = value; }
        }

        public OutStockCheckManger()
        {
            checker = DalFactory.CreateOutStockChecker();
            rfids = new List<string>();
        }

        /// <summary>
        /// 清除当前的RFID信息列表
        /// </summary>
        public void ClearRFIDs()
        {
            rfids.Clear();
        }

        public void AddRFID(string rfid)
        {
            rfids.Add(rfid);
        }
        public void AddRFID(List<string> lstRfid)
        {
            rfids.AddRange(lstRfid);
        }

        /// <summary>
        /// 检验当前数据
        /// </summary>
        /// <returns></returns>
        public List<string> Check()
        {
            List<string> retVals = checker.CheckOutStockRFIDs(rfids);
            ClearRFIDs();
            return retVals;

        }
        
    }
}
